package org.luxor.eshop.account.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.luxor.commons.core.validator.group.UpdateGroup;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;


/**
 * 账户
 *
 * @author administrator @date 2020-12-04 15:42:06
 */
@Data
@TableName("tb_account")
@ApiModel(description = "")
public class AccountEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键Id")
    @JSONField(serializeUsing = ToStringSerializer.class)
    @NotNull(message = "accountId，不能为空", groups = UpdateGroup.class)
    private Long accountId;

    @ApiModelProperty(value = "账户编号")
    private String account;

    @ApiModelProperty(value = "账户姓名")
    private String name;

    @ApiModelProperty(value = "账户余额( 账户显示余额=当前余额-预冻结-业务冻结金额 )")
    private BigDecimal balance;

    @ApiModelProperty(value = "未达金额")
    private BigDecimal outstandingAmount;

    @ApiModelProperty(value = "预冻结余额")
    private BigDecimal preFrozenAmount;

}
